package com.egg.mall.model.response.web;

import com.egg.common.core.model.response.BaseResponse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;


@Data
@ApiModel(value = "SPU信息")
public class SpuInfo extends BaseResponse {


    @ApiModelProperty(value = "SPU ID")
    private Long id;

    @ApiModelProperty(value = "分类ID")
    private Long categoryId;

    @ApiModelProperty(value = "品牌ID")
    private Long brandId;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "原价格(单位:分)")
    private Long originPrice;

    @ApiModelProperty(value = "现价格(单位:分)")
    private Long price;

    @ApiModelProperty(value = "销售量")
    private Integer sales;

    @ApiModelProperty(value = "图片地址")
    private String picUrl;

    @ApiModelProperty(value = "图册")
    private List<String> subPicUrls;

    @ApiModelProperty(value = "单位")
    private String unit;

    @ApiModelProperty(value = "简介")
    private String description;

    @ApiModelProperty(value = "详情")
    private String detail;

    @ApiModelProperty(value = "状态")
    private Boolean state;

    @ApiModelProperty(value = "SPU属性")
    private List<SpuAttribute> attrList;

    @ApiModelProperty(value = "SPU规格")
    private List<SpuAttribute> specList;

    @ApiModelProperty(value = "SKU集合")
    private List<Sku> skuList;

    @Data
    @ApiModel(value = "SpuInfo.SpuAttribute")
    public static class SpuAttribute {

        @ApiModelProperty(value = "ID")
        private String id;

        @ApiModelProperty(value = "(属性/规格)名称")
        private String name;

        @ApiModelProperty(value = "(属性/规格)值")
        private String value;

        @ApiModelProperty(value = "图片地址")
        private String picUrl;

    }

    @Data
    @ApiModel(value = "SpuInfo.Sku")
    public static class Sku {


        @ApiModelProperty(value = "SKU ID")
        private Long id;

        @ApiModelProperty(value = "SKU编码")
        private String code;

        @ApiModelProperty(value = "SPU ID")
        private Long spuId;

        @ApiModelProperty(value = "SKU名称")
        private String name;

        @ApiModelProperty(value = "SKU价格(单位:分)")
        private Long price;

        @ApiModelProperty(value = "SKU库存数量")
        private Integer stockQuantity;

        @ApiModelProperty(value = "SKU图片地址")
        private String picUrl;

        @ApiModelProperty(value = "规格值, 以英文逗号(,)分割")
        private String specIds;


    }


}
